<?php
namespace Admin\Controller;
use Think\Controller;
use Think\Verify;
use Admin\Model\AdminModel;

/**
 * 后台登录控制器
 * Class LoginController
 * @package Admin\Controller
 */
class LoginController extends Controller{
    /**
     * 登录页面
     */
    public function index(){
        $this->display();
    }

    /**
     * 生成验证码
     */
    public function verify(){
    	 ob_end_clean();
        $config = [
            'fontSize' => 30,
            'length'   => 4,
        ];

        $Verify = new Verify($config);
        $Verify->entry();
    }

    /**
     * 退出登录
     */
    public function logout(){
        session('admin_id',null);
        session('admin_username',null);

        $this->ajaxReturn(['info'=>'退出成功','status'=>200]);
    }


}